package com.yonyou.pmclouds.basecom.bp.processor;

import com.yonyou.pmclouds.basecom.runtime.RuntimeEnvironment;
import com.yonyou.pmclouds.basecom.util.BeanHelper;
import com.yonyou.pmclouds.basecom.util.CommonFieldConst;

import java.util.Date;

public class AuditInfoUpdateMultiProcessor<T> implements MultiProcessorWithField<T> {
    @Override
    public void process(T[] vos, T[] origs) {
        for (T vo : vos) {
            BeanHelper.setProperty(vo, CommonFieldConst.MODIFIER, RuntimeEnvironment.getLoginUserId());
            BeanHelper.setProperty(vo, CommonFieldConst.MODIFYTIME, new Date(System.currentTimeMillis()));
        }
    }

    @Override
    public String[] getChangedField() {
        return new String[]{CommonFieldConst.MODIFIER, CommonFieldConst.MODIFYTIME};
    }
}
